package Shopcar;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);

        ArrayList<Commodity>shopCar=new ArrayList<>();
        double sumPrice=0;
        CommodityOp cp=new CommodityOp(shopCar);
        Commodity cy=new Commodity("沐浴露",12,"可以清理身体但是别用来洗头。",100);
        Commodity cy1=new Commodity("洗发水",12,"可以用来洗头但是洗身体没用。",100);
        Commodity cy2=new Commodity("华子",90,"抽烟就要抽华子。",100);
        shopCar.add(cy);
        shopCar.add(cy1);
        shopCar.add(cy2);
        for (int i = 0; i < shopCar.size(); i++) {
            shopCar.get(i).String();
            sumPrice += shopCar.get(i).getPrice();
        }
        System.out.println("总价格：" +sumPrice);
        System.out.println("请输入你需要做的功能：");

            String s=sc.next();
            switch (s) {
                case "添加":
                    cp.add();
                    break;
                case "删除":
                    cp.delete();
                    break;
                default:break;
            }

        }
    }

